/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package vista;

import java.awt.Toolkit;
import java.awt.event.ActionListener;
import java.awt.event.MouseListener;
import java.util.List;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;
import modelo.Usuario;

/**
 *
 * @author Joseph Tello Wong
 */
public class VistaPrincipalUsuarios extends javax.swing.JFrame {

    private vistaNuevoUsuario nuevoUsuario;
    private vistaNuevoRole nuevoRole;
    private vistaAsignarRol asignarRol;
    private vistaCambiarContraseña cambiarContraseña;
    private DefaultTableModel modelo = new DefaultTableModel();

    /**
     * Creates new form VistaPrincipalUsuarios
     */
    public VistaPrincipalUsuarios() {
        initComponents();
        nuevoUsuario = new vistaNuevoUsuario();
        nuevoRole = new vistaNuevoRole();
        asignarRol = new vistaAsignarRol();
        cambiarContraseña = new vistaCambiarContraseña();
        DefaultTableModel modelo = new DefaultTableModel();
        //setVisible(false);

        this.textoDescripcion.setWrapStyleWord(
                true);
        setLocationRelativeTo(
                null);
        this.setResizable(false);
        iniciarLogo();
    }

    public vistaNuevoUsuario getVistaNuevoUsuario() {
        return this.nuevoUsuario;
    }

    public vistaNuevoRole getVistaRole() {
        return this.nuevoRole;
    }

    public vistaAsignarRol getAsignaRol() {
        return this.asignarRol;
    }

    private vistaCambiarContraseña getCambiarPass() {
        return this.cambiarContraseña;
    }

    public final void iniciarLogo() {
        setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource("./image/logo.png")));
    }

    public void agregarListenerItemCerrar(ActionListener actionListener) {
        this.itemCerrar.addActionListener(actionListener);
    }

    public void agregarListenerItemAcerdaDe(ActionListener actionListener) {
        this.itemAcercaDe.addActionListener(actionListener);
    }

    public void agregarListenerItemCambiarMonitor(ActionListener actionListener) {
        this.itemMonitores.addActionListener(actionListener);
    }

    public void agregarListenerItemOpcionesUsuario(ActionListener actionListener) {
        this.opcionesUsuario.addActionListener(actionListener);
    }

    public void agregarListenerTablaUsuario(MouseListener mouseListener) {
        this.tablaUsuarios.addMouseListener(mouseListener);
    }

    public void agregarListenerCrearUsuario(ActionListener actionListener) {
        this.botonNuevoUsuario.addActionListener(actionListener);
    }

    public void agregarListenerCrearRole(ActionListener actionListener) {
        this.botonNuevoRol.addActionListener(actionListener);
    }

    public void agregarListenerAsignarRol(ActionListener actionListener) {
        this.botonAsignarRol.addActionListener(actionListener);
    }

    public void agregarListenerGuardarContraseña(ActionListener actionListener) {
        this.botonContraseña.addActionListener(actionListener);
    }

    public void agregarListenerDesActivarUsuario(ActionListener actionListener) {
        this.botonDesactivar.addActionListener(actionListener);
    }

    public void agregarListenerGuardarDescripcion(ActionListener actionListener) {
        this.botonGuardar.addActionListener(actionListener);
    }

    public void agregarUsuarios(List<Usuario> usuarios) {
        this.modelo = (DefaultTableModel) this.tablaUsuarios.getModel();
        for (Usuario usuario : usuarios) {
            modelo.addRow(new Object[]{usuario});
        }
        this.tablaUsuarios.setModel(modelo);
        this.tablaUsuarios.repaint();
    }

    public void agregarInformacionUsuario(List<String> informacionUsuario) {
        this.modelo = (DefaultTableModel) this.tablaInformacion.getModel();
        while (this.tablaInformacion.getRowCount() > 0) {
            this.modelo.removeRow(0);
        }
        this.tablaInformacion.setModel(modelo);
        this.tablaInformacion.repaint();

        for (String infoUsuario : informacionUsuario) {
            this.modelo.addRow(new Object[]{infoUsuario});
        }
        this.tablaInformacion.setModel(modelo);
        this.tablaInformacion.repaint();
    }

    public String cambioOpcionesUsuario() {
        return (String) opcionesUsuario.getSelectedItem();
    }

    public String obtenerUsuario() {
        return this.textoUsuario.getText();
    }

    public void setColumnaInformacion(String opcion) {
        this.modelo = new DefaultTableModel(new Object[][]{}, new String[]{opcion});
        this.tablaInformacion.setModel(modelo);
    }

    // Eventos de las subventanas.
    public void agregarListenerItemBotonCrearUsuario(ActionListener actionListener) {
        this.nuevoUsuario.getBotonCrearUsuario().addActionListener(actionListener);
    }

    public void agregarListenerItemBotonCrearRole(ActionListener actionListener) {
        this.nuevoRole.getBotonCrearRole().addActionListener(actionListener);
    }

    public void agregarListenerItemBotonAsignarRol(ActionListener actionListener) {
        this.asignarRol.getBotonAsignarRol().addActionListener(actionListener);
    }

    public void agregarListenerItemBotonGuardarContraseña(ActionListener actionListener) {
        this.cambiarContraseña.getBotonGuardarContraseña().addActionListener(actionListener);
    }

    public vistaNuevoUsuario getNuevoUsuario() {
        return nuevoUsuario;
    }

    public vistaNuevoRole getNuevoRole() {
        return nuevoRole;
    }

    public vistaAsignarRol getAsignarRol() {
        return asignarRol;
    }

    public vistaCambiarContraseña getCambiarContraseña() {
        return cambiarContraseña;
    }

    public void mostrarNuevoUsuario(List<String> tablespaces) {
        this.nuevoUsuario.cargarTablespaces(tablespaces);
        this.nuevoUsuario.setVisible(true);
    }

    public void mostrarNuevoRole(List<String> privilegios) {
        this.nuevoRole.cargarPrivilegios(privilegios);
        this.nuevoRole.setVisible(true);
    }

    public void mostrarAsignarRol(List<Usuario> usuarios, List<String> roles) {
        this.asignarRol.cargarUsuarios(usuarios);
        this.asignarRol.cargarRoles(roles);
        this.asignarRol.setVisible(true);
    }

    public void mostrarCambiarContraseña() {
        this.cambiarContraseña.setNombreUsuario(this.textoUsuario.getText());
        this.cambiarContraseña.setVisible(true);
    }

    public String obtenerDescripcion() {
        return this.textoDescripcion.getText();
    }

    public void setDescripcion(String descripcion) {
        this.textoDescripcion.setText(descripcion);
    }

    public int obtenerCantidadUsuarios() {
        return this.tablaUsuarios.getRowCount();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jButton1 = new javax.swing.JButton();
        jPanel1 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        tablaUsuarios = new javax.swing.JTable();
        jPanel3 = new javax.swing.JPanel();
        opcionesUsuario = new javax.swing.JComboBox();
        jScrollPane2 = new javax.swing.JScrollPane();
        tablaInformacion = new javax.swing.JTable();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        textoUsuario = new javax.swing.JTextField();
        textoDefaultTS = new javax.swing.JTextField();
        textTempTS = new javax.swing.JTextField();
        botonDesactivar = new javax.swing.JButton();
        botonContraseña = new javax.swing.JButton();
        jScrollPane3 = new javax.swing.JScrollPane();
        textoDescripcion = new javax.swing.JTextArea();
        jLabel4 = new javax.swing.JLabel();
        botonGuardar = new javax.swing.JButton();
        jPanel4 = new javax.swing.JPanel();
        botonNuevoRol = new javax.swing.JButton();
        botonAsignarRol = new javax.swing.JButton();
        botonNuevoUsuario = new javax.swing.JButton();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        itemMonitores = new javax.swing.JMenuItem();
        itemCerrar = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();
        itemAcercaDe = new javax.swing.JMenuItem();

        jButton1.setText("jButton1");

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Monitor de control de usuarios");

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)), "Usuarios presentes en Oracle"));

        tablaUsuarios.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Nombre de usuario"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        tablaUsuarios.getTableHeader().setReorderingAllowed(false);
        tablaUsuarios.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tablaUsuariosMouseClicked(evt);
            }
        });
        jScrollPane1.setViewportView(tablaUsuarios);
        tablaUsuarios.getColumnModel().getColumn(0).setResizable(false);

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 178, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 210, Short.MAX_VALUE)
                .addContainerGap())
        );

        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)), "Opciones de usuario"));

        opcionesUsuario.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Roles asociados", "Privilegios asociados", "Objetos asociados", "Cuotas por tablespace"}));
        opcionesUsuario.setEnabled(false);

        tablaInformacion.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Roles asociados"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        tablaInformacion.setEnabled(false);
        tablaInformacion.getTableHeader().setReorderingAllowed(false);
        jScrollPane2.setViewportView(tablaInformacion);
        tablaInformacion.getColumnModel().getColumn(0).setResizable(false);

        jLabel1.setText("Usuario:");

        jLabel2.setText("Default tablespace:");

        jLabel3.setText("Temporary tablespace:");

        textoUsuario.setEditable(false);

        textoDefaultTS.setEditable(false);

        textTempTS.setEditable(false);

        botonDesactivar.setText("Activar/Desactivar usuario");

        botonContraseña.setText("Cambiar contraseña");

        textoDescripcion.setColumns(20);
        textoDescripcion.setRows(5);
        textoDescripcion.setEnabled(false);
        jScrollPane3.setViewportView(textoDescripcion);

        jLabel4.setText("Descripción del usuario:");

        botonGuardar.setText("Guardar");

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jLabel2, javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jLabel3, javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(textoUsuario, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 187, Short.MAX_VALUE)
                        .addComponent(textoDefaultTS, javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(textTempTS, javax.swing.GroupLayout.Alignment.LEADING))
                    .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 188, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel4)
                    .addComponent(botonGuardar, javax.swing.GroupLayout.Alignment.TRAILING))
                .addGap(22, 22, 22)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(botonContraseña, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(botonDesactivar, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 264, Short.MAX_VALUE)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                    .addComponent(opcionesUsuario, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(opcionesUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(11, 11, 11))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(botonDesactivar, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(botonContraseña, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(textoUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(textoDefaultTS, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(textTempTS, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel4)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jScrollPane3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(botonGuardar)))
                .addContainerGap())
        );

        jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)), "Más opciones"));

        botonNuevoRol.setText("Nuevo rol");

        botonAsignarRol.setText("Asignar un rol");

        botonNuevoUsuario.setText("Nuevo usuario");

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(botonAsignarRol, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(botonNuevoRol, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(botonNuevoUsuario, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(botonNuevoUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 11, Short.MAX_VALUE)
                .addComponent(botonNuevoRol, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(botonAsignarRol, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        jMenu1.setText("Archivo");

        itemMonitores.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_M, java.awt.event.InputEvent.CTRL_MASK));
        itemMonitores.setText("Cambiar Monitor");
        jMenu1.add(itemMonitores);

        itemCerrar.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_X, java.awt.event.InputEvent.CTRL_MASK));
        itemCerrar.setText("Cerrar");
        jMenu1.add(itemCerrar);

        jMenuBar1.add(jMenu1);

        jMenu2.setText("Ayuda");

        itemAcercaDe.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_H, java.awt.event.InputEvent.CTRL_MASK));
        itemAcercaDe.setText("Acerca de");
        jMenu2.add(itemAcercaDe);

        jMenuBar1.add(jMenu2);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(18, 18, 18)
                .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(20, 20, 20)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void tablaUsuariosMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tablaUsuariosMouseClicked
        JTable target = (JTable) evt.getSource();
        int row = target.getSelectedRow();
        int column = target.getSelectedColumn();
        Usuario usuario = (Usuario) target.getModel().getValueAt(row, column);

        this.textoUsuario.setText(usuario.getUser());
        this.textoDefaultTS.setText(usuario.getDefaultTablespace());
        this.textTempTS.setText(usuario.getTemporaryTablespace());
        this.opcionesUsuario.setEnabled(true);
        this.tablaInformacion.setEnabled(true);
        this.textoDescripcion.setEnabled(true);
    }//GEN-LAST:event_tablaUsuariosMouseClicked

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;

                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(VistaPrincipalUsuarios.class
                    .getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(VistaPrincipalUsuarios.class
                    .getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(VistaPrincipalUsuarios.class
                    .getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(VistaPrincipalUsuarios.class
                    .getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new VistaPrincipalUsuarios().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton botonAsignarRol;
    private javax.swing.JButton botonContraseña;
    private javax.swing.JButton botonDesactivar;
    private javax.swing.JButton botonGuardar;
    private javax.swing.JButton botonNuevoRol;
    private javax.swing.JButton botonNuevoUsuario;
    private javax.swing.JMenuItem itemAcercaDe;
    private javax.swing.JMenuItem itemCerrar;
    private javax.swing.JMenuItem itemMonitores;
    private javax.swing.JButton jButton1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JComboBox opcionesUsuario;
    private javax.swing.JTable tablaInformacion;
    private javax.swing.JTable tablaUsuarios;
    private javax.swing.JTextField textTempTS;
    private javax.swing.JTextField textoDefaultTS;
    private javax.swing.JTextArea textoDescripcion;
    private javax.swing.JTextField textoUsuario;
    // End of variables declaration//GEN-END:variables
}
